package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.SysSetting;
import com.ruoyi.system.mapper.SysSettingMapper;
import com.ruoyi.system.service.ISysSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 系统设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-23
 */
@Service
public class SysSettingServiceImpl implements ISysSettingService
{
    @Autowired
    private SysSettingMapper sysSettingMapper;

    /**
     * 查询系统设置
     * 
     * @param userId 用户ID
     * @return 系统设置
     */
    @Override
    public SysSetting selectSysSettingByUserId(Long userId)
    {
        return sysSettingMapper.selectSysSettingByUserId(userId);
    }

    @Override
    public SysSetting selectSysSettingByCellId(Long cellId) {
        return sysSettingMapper.selectSysSettingByCellId(cellId);
    }

    /**
     * 查询系统设置列表
     * 
     * @param sysSetting 系统设置
     * @return 系统设置
     */
    @Override
    public List<SysSetting> selectSysSettingList(SysSetting sysSetting)
    {
        return sysSettingMapper.selectSysSettingList(sysSetting);
    }

    /**
     * 新增系统设置
     * 
     * @param sysSetting 系统设置
     * @return 结果
     */
    @Override
    public int insertSysSetting(SysSetting sysSetting)
    {
        return sysSettingMapper.insertSysSetting(sysSetting);
    }

    /**
     * 修改系统设置
     * 
     * @param sysSetting 系统设置
     * @return 结果
     */
    @Override
    public int updateSysSetting(SysSetting sysSetting)
    {
        return sysSettingMapper.updateSysSetting(sysSetting);
    }

    /**
     * 批量删除系统设置
     * 
     * @param userIds 需要删除的系统设置主键
     * @return 结果
     */
    @Override
    public int deleteSysSettingByUserIds(Long[] userIds)
    {
        return sysSettingMapper.deleteSysSettingByUserIds(userIds);
    }

    /**
     * 删除系统设置信息
     * 
     * @param userId 系统设置主键
     * @return 结果
     */
    @Override
    public int deleteSysSettingByUserId(Long userId)
    {
        return sysSettingMapper.deleteSysSettingByUserId(userId);
    }
}
